<!--
Copyright (c) 2021-2024 SigScalr, Inc.

This file is part of SigLens Observability Solution

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

<!DOCTYPE html>
<html lang="en">

<script async src="https://www.googletagmanager.com/gtag/js?id=G-5SBJC04YFB"></script>
<script>
    window.dataLayer = window.dataLayer || [];
    function gtag() { dataLayer.push(arguments); }
    gtag('js', new Date());

    gtag('config', 'G-5SBJC04YFB');
</script>

<head>
    <meta charset="UTF-8">
    <title>SigLens</title>

    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png">
    <link rel="manifest" href="assets/site.webmanifest">
    <link rel="mask-icon" href="assets/safari-pinned-tab.svg" color="#5bbad5">
    <meta name="msapplication-TileColor" content="#da532c">

    <link rel="stylesheet" href="./css/lib/bootstrap.min.css" />
    <link rel="stylesheet" href="./css/lib/all.min.css" />
    <link rel="stylesheet" href="./css/lib/ag-grid.min.css" />
    <link rel="stylesheet" href="./css/siglens.css?cb={{ AppVersion }}" />

    <script src="./js/lib/lodash.min.js"></script>
    <script src="./js/lib/jquery-3.6.0.min.js"></script>
    <script src="./js/lib/jquery-ui.min.js"></script>
    <script src="./js/lib/js.cookie.min.js"></script>
    <script src="./js/lib/moment.min.js"></script>
    <script src="./js/lib/date_fns.min.js"></script>
    <script src="./js/lib/popper.min.js"></script>
    <script src="./js/lib/bootstrap.bundle.min.js"></script>
    <script src="./js/lib/ag-grid-community.min.noStyle.js"></script>
    <script src="./js/lib/lucide.min.js"></script>
    <script>
        var defaultTheme = Cookies.get('theme') || 'light';
        $('html').attr('data-theme', defaultTheme);
    </script>
    {{ .RunCheck1 | safeHTML }}
</head>

<body>
    <div id="app-container">

        <div id="app-side-nav">
        </div>

        <div id="alerting">
            <div class="all-alert-page d-none">
                <div class="alerts-nav-tab">
                </div>
                <div class="upper-header">
                    <p class="caption">Rules that determine whether an alert will fire
                    </p>
                    <button class="btn btn-primary" id="new-alert-rule">
                        <span>
                            <img src="./assets/add-icon.svg" class="add-icon">Add Alert Rule
                        </span>
                    </button>
                </div>
                <div class="d-flex w-100 gap-3 align-items-center mb-3">
                    <input type="text" id="alert-search" class="search-input" placeholder="Search alerts by name">
                    <div class="d-flex gap-2 align-items-center">
                        <span class="filter-label">State:</span>
                        <div class="dropdown filter-dropdown">
                            <button class="btn dropdown-toggle" type="button" id="state-filter-btn"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
                                data-bs-toggle="dropdown">
                                <span id="state-filter-text">All States</span>
                                <i class="dropdown-arrow"></i>
                            </button>
                            <div class="dropdown-menu box-shadow state-filter-options" aria-labelledby="state-filter-btn">
                                <li class="filter-option active" data-value="">All States</li>
                                <li class="filter-option" data-value="Normal">Normal</li>
                                <li class="filter-option" data-value="Pending">Pending</li>
                                <li class="filter-option" data-value="Firing">Firing</li>
                                <li class="filter-option" data-value="Inactive">Inactive</li>
                            </div>
                        </div>
                    </div>
                    <div class="d-flex gap-2 align-items-center">
                        <span class="filter-label">Type:</span>
                        <div class="dropdown filter-dropdown">
                            <button class="btn dropdown-toggle" type="button" id="type-filter-btn"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
                                data-bs-toggle="dropdown">
                                <span id="type-filter-text">All Types</span>
                                <i class="dropdown-arrow"></i>
                            </button>
                            <div class="dropdown-menu box-shadow type-filter-options" aria-labelledby="type-filter-btn">
                                <li class="filter-option active" data-value="">All Types</li>
                                <li class="filter-option" data-value="Logs">Logs</li>
                                <li class="filter-option" data-value="Metrics">Metrics</li>
                            </div>
                        </div>
                    </div>
                    <button id="clear-filters" class="clear-filters-btn btn btn-grey">Clear Filters</button>
                </div>
                <div id="alert-grid-container">
                    <div id="ag-grid" class="ag-theme-mycustomtheme">
                    </div>
                </div>
                <div class="popupOverlay">
                </div>
                <div class="popupContent">
                    <h3 class="header">Confirmation</h3>
                    <p id="delete-alert-name">Are you sure you want to delete this Alert?</p>
                    <div class="btncontainer">
                        <button type="button" id="cancel-btn" class="btn btn-primary">Cancel</button>
                        <button type="button" id="delete-btn" class="btn btn-secondary">Delete</button>
                    </div>
                </div>
            </div>
            <div class="create-alert-page d-none">
                <div>
                    <h3 class="myOrg-heading submenu-heading">Create New Alert</h3>
                    <p class="caption submenu-caption mt-0">Choose an alert type to begin monitoring your systems</p>
                </div>
                <div class="submenu-container">
                    <div class="alert-card" id="create-logs-alert">
                        <div class="header">
                            <div class="icon-wrapper logs-icon">
                                <i data-lucide="database" class="database-icon"></i>
                            </div>
                            <div>
                                <h2 class="card-title">Logs</h2>
                                <p class="card-description">Monitor log patterns, errors, and events</p>
                            </div>
                    </div>
                        <div class="card-content">
                            <div class="use-cases-header">
                                <span class="use-cases-title">Common use cases:</span>
                                <span class="active-count logs-count"></span>
                            </div>
                            <div class="use-case">
                                <i data-lucide="clock" class="clock-icon"></i>
                                Error patterns
                            </div>
                            <div class="use-case">
                                <i data-lucide="clock" class="clock-icon"></i>
                                Missing logs
                            </div>
                        </div>
                    </div>
                    <div class="alert-card" id="create-metrics-alert">
                        <div class="header">
                            <div class="icon-wrapper metrics-icon">
                                <i data-lucide="chart-line" class="graph-icon"></i>
                            </div>
                            <div>
                                <h2 class="card-title">Metrics</h2>
                                <p class="card-description">Track performance metrics and resource usage</p>
                            </div>
                        </div>
                        <div class="card-content">
                            <div class="use-cases-header">
                                <span class="use-cases-title">Common use cases:</span>
                                <span class="active-count metrics-count"></span>
                            </div>
                            <div class="use-case">
                                <i data-lucide="clock" class="clock-icon"></i>
                                CPU/Memory
                            </div>
                            <div class="use-case">
                                <i data-lucide="clock" class="clock-icon"></i>
                                Custom metrics
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="app-footer">
        </div>

    </div>

    <script src="./js/navbar.js?cb={{ AppVersion }}"></script>
    <script src="./js/common.js?cb={{ AppVersion }}"></script>
    <script src="./js/event-handlers.js?cb={{ AppVersion }}"></script>
    <script src="./js/date-picker.js?cb={{ AppVersion }}"></script>
    <script src="./js/all-alerts.js?cb={{ AppVersion }}"></script>
    <script src="./component/upper-navbar/upper-navbar.js?cb={{ AppVersion }}"></script>
    <script src="./js/footer.js?cb={{ AppVersion }}"></script>

    {{ .RunCheck2 | safeHTML }}
    {{ .RunCheck3 | safeHTML }}
</body>

</html>